home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994…tember: Reference Library / Dev.CD Sep 94.toast / Periodicals / develop / develop Issue 19 / develop 19 code / SimpliFace_V2 / Sources / ScriptUtils.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-04-15  |  2.4 KB  |  107 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        ScriptUtils.h
  3.  
  4.     Contains:    Script handling & OSA interface
  5.  
  6.  
  7.     Developed by:
  8.  
  9.     Paul G Smith (commstalk hq & Full Moon Software, Inc)
  10.  
  11.     you can leave messages at (UK): 0727 844232; (US): 408 253 7199
  12.     BUT I prefer to be contacted by e-mail
  13.     AppleLink:     COMMSTALK.HQ
  14.     Internet:     COMMSTALK.HQ@applelink.apple.com
  15.  
  16.     "SimpliFace2" Sample code to accompany develop article
  17.     on techniques for controlling script inheritance.
  18.     
  19.     
  20.  
  21.  
  22.     
  23.  
  24. */
  25.  
  26.  
  27. #ifndef __SCRIPTUTILS__
  28. #define __SCRIPTUTILS__
  29.  
  30.  
  31. #ifndef __APPLEEVENTS__
  32. #include "AppleEvents.h"
  33. #endif
  34.  
  35. #ifndef __PASCALSTRING__
  36. #include <PascalString.h>
  37. #endif
  38.  
  39. #ifndef __AERegistry__
  40. #include <AERegistry.h>
  41. #endif
  42.  
  43. #ifndef __OSA__
  44. #include <OSA.h>
  45. #endif
  46.  
  47.  
  48. #define    kEndOfList            NULL        // Nil terminator for variable argument list.
  49.  
  50. /**-----------------------------------------------------------------------
  51.     Utility Routines for getting data from AEDesc's
  52.   -----------------------------------------------------------------------**/
  53.     
  54. pascal void GetRawDataFromDescriptor(const AEDesc *theDesc,
  55.                                      Ptr     destPtr,
  56.                                      Size    destMaxSize,
  57.                                      Size    *actSize);
  58.                                                                          
  59. pascal OSErr GetDescTypeFromDescriptor(const AEDesc *sourceDesc, DescType *result);
  60.                                                                          
  61. pascal OSErr GetPStringFromDescriptor(const AEDesc *sourceDesc, char *resultStr);
  62.  
  63. pascal OSErr GetIntegerFromDescriptor(const AEDesc *sourceDesc, short *result);
  64.     
  65. pascal OSErr GetBooleanFromDescriptor(const AEDesc *sourceDesc, Boolean *result);
  66.                                                                             
  67. pascal OSErr GetLongIntFromDescriptor(const AEDesc *sourceDesc, long *result);
  68.  
  69. pascal OSErr GetRectFromDescriptor(const AEDesc *sourceDesc, Rect *result);
  70.  
  71. pascal OSErr GetPointFromDescriptor(const AEDesc *sourceDesc, Point *result);
  72.  
  73. pascal OSErr GetCStringFromDescriptor(const AEDesc *sourceDesc, CStr255 *resultStr);
  74.  
  75.  
  76. OSErr    MakeNullDesc(AEDesc *dataDesc);
  77.  
  78. OSErr    MakeNameDesc(CStr255& theString, AEDesc *dataDesc);
  79.  
  80. OSErr    MakeLongIntDesc(long theIndex, AEDesc *dataDesc);
  81.  
  82.  
  83.  
  84. pascal WindowPtr WindowNameToWindowPtr(StringPtr nameStr);
  85.  
  86. pascal WindowPtr GetWindowPtrOfNthWindow(short index);
  87.  
  88. pascal short CountWindows(void);
  89.  
  90.  
  91. pascal OSErr FindApplicationOnVolume(OSType whatSig, short theVol, FSSpec *foundSpec);
  92.  
  93. void InitAEDescs(AEDesc*  desc1, ... );            // Null terminated argument list.
  94. void DisposeAEDescs(AEDesc*  desc1, ... );    // Null terminated argument list.
  95.  
  96.  
  97.  
  98.  
  99.  
  100. Boolean    ScriptIsScriptContext(ComponentInstance scriptingComponent,
  101.                                 OSAID contextID);
  102.  
  103.  
  104.  
  105.  
  106. #endif
  107.